#include <stdio.h>
#define my_offsetof(type, member) (size_t)&(((type*)0)->member)

struct test
{
    int a;
    char b;
    char c;
};

int main()
{
    printf("%d\n", my_offsetof(struct test, a));
    printf("%d\n", my_offsetof(struct test, b));
    printf("%d\n", my_offsetof(struct test, c));
    return 0;
}